/*
 * api.js
 * 用户接口
 * date: 2021-07-13
 */
import request from '@/utils/request.js'
// 登录注册
const apiUrl = '/api/'
export const api = {
	// 注册
	reguser: (param = {}, config = {}) => request.post(`${apiUrl}reguser`, param, config),
	// 登录
	login: (param = {}, config = {}) => request.post(`${apiUrl}login`, param, config),
};

// 用户信息
const useUrl = '/my/'
export const use = {
	// 获取用户的基本信息
	get: (param = {}, config = {}) => request.get(`${useUrl}userinfo`, param, config),
	// 更新用户的基本信息
	update: (param = {}, config = {}) => request.post(`${useUrl}userinfo`, param, config),
	// 更新用户的密码
	updatepwd: (param = {}, config = {}) => request.post(`${useUrl}updatepwd`, param, config),
	// 更新用户头像
	avatar: (param = {}, config = {}) => request.post(`${useUrl}update/avatar`, param, config),
}

export default { api, use };